FVG 9:31–10:00 AM ETFVG 9:31–10:00 AM ET - Script Description
What This Script Does
This indicator finds **Fair Value Gaps (FVGs)** that form during the first 29 minutes of the U.S. stock market (9:31 AM to 10:00 AM Eastern Time). A Fair Value Gap is a price imbalance where there's a gap between candles that often becomes an important support or resistance level.
Key Features:
- **Time Window**: Only looks for FVGs between 9:31-10:00 AM ET (most important opening period)
- **One Per Day**: Finds only the first FVG that forms in this time window each day
- **Visual Display**: Draws a purple box around the gap with a clear "FVG" label
- **Price Tracking**: Monitors when price comes back to test the gap level
- **Alert System**: Sends notifications when price returns to the FVG zone
How FVGs Are Detected:
- **Bullish FVG**: When there's a gap up (low of middle candle is above high of 3rd candle back)
- **Bearish FVG**: When there's a gap down (high of middle candle is below low of 3rd candle back)
The 9:31-10:00 AM window is chosen because this is when institutions and algorithms create their biggest price moves right after market open, making these gaps very reliable.
Customization Options
User Settings
Extend FVG Box (Bars)
- **What it does**: Makes the purple box longer to the right
- **Default**: 0 (box ends right after the gap forms)
- **Options**: Any number from 0 to 100+
- **When to use**: 
  - Keep at 0 for clean historical view
  - Set to 10-20 to track the gap during the current session
  - Set higher for longer reference
Code Settings (Can Be Changed)
Time Window
- **Start**: 9:31 AM Eastern Time
- **End**: 10:00 AM Eastern Time
- **Can modify**: Change the hour/minute numbers in the code
Visual Style
- **Color**: Purple with see-through background
- **Label**: Shows "FVG" text in white
- **Can modify**: Change colors and transparency in the code
How to Use:
Setup
Chart Settings
1. Use 1-minute, 5-minute, or 15-minute charts (works best on these timeframes)
2. Apply to liquid markets like ES, NQ, major stocks, or forex pairs
3. Set the "Extend FVG Box" to your preference (start with 0 or 10)
What You'll See
- A purple box appears when an FVG forms during 9:31-10:00 AM
- Box shows the exact price levels of the gap
- "FVG" label appears on the box
- Only one FVG per day will be marked
Trading Strategies
Basic FVG Trading
1. **Wait for Formation**: Let the purple box appear during 9:31-10:00 AM
2. **Watch Price Movement**: See if price moves away from the gap
3. **Enter on Retest**: When price comes back to the purple box area, consider entering
4. **Trade Direction**: 
   - Bullish FVG = look for long opportunities when price retests
   - Bearish FVG = look for short opportunities when price retests
Entry Methods
- **Bounce Play**: Enter when price touches the FVG box and bounces away
- **Break Play**: Enter if price strongly breaks through the FVG box
- **Rejection Play**: Enter opposite direction if price gets rejected at the FVG
Risk Management
Stop Losses
- Place stops just outside the FVG box (a few ticks beyond the gap)
- If trading a bounce, stop goes on opposite side of the gap
- If trading a break, stop goes back inside the gap
Position Sizing
- Start small until you understand how FVGs work in your market
- Bigger gaps = smaller position size (more risk)
- Smaller gaps = can use larger position size
Profit Targets
- Take profits at obvious levels like round numbers, previous highs/lows
- Consider taking half profits at 1:1 risk/reward ratio
- Let some position run if the move is strong
Best Practices
When It Works Best
- High-volume stocks and futures (ES, NQ work great)
- Normal market days without major news during the 9:31-10:00 window
- When there's clear institutional activity in the opening period
When to Be Careful
- Low-volume stocks or markets
- Major economic news releases during the time window
- Market holidays when volume is low
- Very choppy or sideways days
Alert Usage
- The script will alert you when price comes back to test the FVG
- Don't trade the alert blindly - always check the current market situation
- Use the alert as a heads-up to start watching the setup more closely
Tips for Success
- The earlier the FVG forms in the 9:31-10:00 window, often the more significant it is
- FVGs that form with high volume are usually more reliable
- Always consider the overall market direction - don't fight the main trend
- Practice on paper first to understand how FVGs behave in your chosen market
🔗 Works Best With:
✅ Liquidity Levels — Smart Swing Lows: Spot key structural lows that can fuel stop hunts and reversals.
✅ ICT Turtle Soup — Liquidity Reversal: Add a classic reversal pattern to your toolkit to catch fakeouts cleanly.
✅ ICT SMC Liquidity Grabs and OBs- Liquidity Grabs, Order Block Zones, and Fibonacci OTE Levels, allowing traders to identify institutional entry models with clean, rule-based visual signals.
This script is most valuable for day traders who want to catch institutional moves right after market open, but it can also help swing traders identify important intraday levels.
✅ ICT Macro Zones (Grey Box Version)- It tracks real-time highs and lows for each Silver Bullet session.
✅ Weekly Opening Gap (cryptonnnite)
Cari dalam skrip untuk "high low"
Rally/Drop Market Structure (Multi-Timeframe)Rally/Drop Market Structure   
 Supply and Demand Zones from Bullish/Bearish Breaks 
 Overview:   
The  Rally/Drop Market Structure  indicator is a powerful price action tool that identifies key structural turning points in the market by detecting  bullish and bearish breaks . After each confirmed break, it plots either a  demand zone  (following a bullish break or rally) or a  supply zone  (following a bearish break or drop). These zones represent institutional footprints — areas where price is likely to react due to imbalance or unfilled orders.
The indicator is based on synthetic higher timeframe (HTF) candles to provide a more stable and smoothed structural map, improving clarity and signal quality over raw candles.
 How It Works:   
- A  bullish break  is defined when price makes a higher high  and  a higher low (or closes above the previous high depending on your selected mode).
- A  bearish break  is defined when price makes a lower high  and  a lower low (or closes below the previous low).
- After a bullish break, the indicator plots a  demand zone  based on the low and high of the most recent bearish candle — representing where demand stepped in.
- After a bearish break, the indicator plots a  supply zone  from the most recent bullish candle — indicating where supply took control.
- Optional  mitigation logic  marks zones as mitigated (or deletes them) once price trades into the opposing side.
- Internal shift detection highlights  swing highs and lows , labels structural points (HH, HL, LH, LL), and identifies potential  liquidity sweeps .
 Features: 
- Dynamic plotting of rally-based demand zones and drop-based supply zones
- Toggle to use  Highs/Lows  or  Close-based breaks  for structure
- Support for LTF, MTF, and HTF analysis (with selectable timeframe)
- Zone mitigation logic with optional automatic cleanup
- Labeling of key swing points:  HH ,  HL ,  LH ,  LL , and  LS  (Liquidity Sweep)
- Zigzag visualization for structure flow
- Alert-ready for internal shifts, BoS, and zone creation
- Separate styling options for BoS lines, internal shift shapes, and zone colors
 How to Use:   
- Set your desired  HTF candle source  (e.g., 1H or 4H) depending on your trading style.
- Use  Highs/Lows  mode for pure price action structure or  Close  mode for more conservative signals.
- Observe when a  bullish break  occurs — a  demand zone  will form where price previously dropped before rallying. Look for long opportunities if price revisits this zone.
- After a  bearish break , a  supply zone  forms where the rally failed — use this to scout short entries on retests.
- Use  BoS lines  to confirm structure shifts and validate entry triggers or trend direction.
- Monitor  mitigated zones  for reduced reliability or avoid them completely by enabling automatic deletion.
- Use alerts to stay notified about key changes without watching the chart constantly.
 Recommended Strategies: 
-  Smart money or ICT-style trading : identify institutional footprints and mitigation setups
-  Reversal trading : catch price rejecting off unmitigated zones after structure break
-  Trend continuation : enter in the direction of internal structure after pullbacks into zones
-  Liquidity sweep confirmation : filter out false breaks using HH/LL with LS detection
 Tips: 
- Combine this indicator with a higher timeframe bias tool (e.g., moving average, higher timeframe market structure).
- For scalping, use tighter HTFs and reduce the zone duration.
- For swing trading, use larger HTFs (1H, 4H, Daily) and increase zone persistence.
 Summary:   
The  Rally/Drop Market Structure  indicator gives you an actionable framework for understanding price structure, market intent, and supply/demand imbalances. Whether you're looking for precision entries, trend confirmation, or smart money concepts, this tool helps simplify complex price behavior into clean, usable structure and zones.
Range Breakout [sgbpulse]Range Breakout  
 1. Overview 
The "Range Breakout  " indicator is a powerful tool designed to identify and visually display price ranges on your chart using pivot points. It dynamically draws two distinct boxes – an External Range and an Internal Range – helping traders pinpoint potential support and resistance zones. Beyond its visual representation, the indicator offers a comprehensive set of 12 unique breakout alerts, providing real-time notifications for significant price movements outside these defined ranges. Additionally, it integrates RSI and MFI metrics for momentum confirmation.
 2. How It Works 
The indicator operates by identifying pivot points based on user-defined "left" and "right" bar lengths. A high pivot is a bar with a specified number of lower highs both to its left and right, and similarly for a low pivot.
 
 External Range: Calculated using longer pivot lengths (default: 15 bars left, 6 bars right). This range represents broader, more significant price consolidation areas.
 Internal Range: Calculated using shorter pivot lengths (default: 4 bars left, 3 bars right). This range captures tighter, more immediate price consolidations within the broader trend.
 
The External Range will always be greater than or equal to the Internal Range, as it's based on a wider historical context. Both ranges are displayed as transparent boxes on your chart, dynamically adjusting as new pivots are formed.
 3. Key Features and Settings 
 Customizable Pivot Lengths: 
 
 External Range (Left/Right Bars): Adjust sensitivity for identifying the broader price range. Longer lengths lead to more stable, but less frequent, range updates.
 Internal Range (Left/Right Bars): Adjust sensitivity for the tighter, more immediate price range.
 Tool Tips: Minimum 6 bars for the External Range, and minimum 2 bars for the Internal Range.
 
 Customizable Range Colors:  Easily change the background colors of the External and Internal Range boxes to match your chart's aesthetic.
 Dynamic Range Display:  The indicator automatically updates the range boxes as new pivot highs and lows are formed, always presenting the most current valid ranges.
 RSI / MFI Settings: 
 
 Timeframe Source: Select the timeframe for RSI and MFI calculation.
- Chart: Calculation based on the current chart timeframe.
- Daily: Always calculated based on the daily ("D") timeframe, even if the chart is on a lower timeframe.
 RSI Length: Period length for RSI calculation (default: 14).
 RSI Overbought Level: Overbought level for RSI (default: 70.0).
 RSI Oversold Level: Oversold level for RSI (default: 30.0).
 MFI Length: Period length for MFI calculation (default: 14).
 MFI Overbought Level: Overbought level for MFI (default: 80.0).
 MFI Oversold Level: Oversold level for MFI (default: 20.0).
 
 4. Synergy of Ranges & Breakout Strength 
The interaction between the External and Internal Ranges provides deep insights into price movement and breakout strength:
 
 Immediate Direction:  The movement of the Internal Range (up or down) indicates the short-term directional bias within the broader framework of the External Range.
 Strength Confirmation:  A breakout of the External Range, followed by a breakout of the Internal Range, confirms the strength of the move and increases confidence in the breakout.
 Strong Momentum ("Leaving" Ranges Behind):  When price breaks out with exceptionally strong momentum, it continues to move aggressively and does not immediately form new pivots. In such situations, the existing ranges (External and Internal) remain in place while the candles "leave them behind." A "Full Candle" breakout, where the entire candle moves past both ranges, indicates a particularly powerful and decisive move.
 Momentum (RSI / MFI) as Confirmation: 
-  RSI (Relative Strength Index):  Measures the speed and change of price movements. Extreme values (above 70 or below 30) indicate overbought/oversold conditions respectively, confirming strong momentum in a breakout.
-  MFI (Money Flow Index):  Similar to RSI but incorporates volume. Extreme values (above 80 or below 20) indicate strong money flow in/out, reinforcing breakout confirmation.
-  Importance of Confirmation:  If a breakout occurs but momentum indicators do not confirm it (for example, an upside breakout while RSI is declining), this could signal weakness in the move and the risk of a false breakout (Fakeout).
 
 5. Visuals 
The indicator provides clear visual representations on the chart:
 Range Boxes: 
 
 Two dynamic boxes are drawn on the chart: one for the External Range and one for the Internal Range.
 These boxes update continuously, displaying the current range boundaries based on the latest pivots. They provide an immediate visual indication of support and resistance levels.
 
 RSI/MFI Status Labels: 
 
 Small text labels appear to the right of the current bar, vertically centered.
 They display the status of RSI and MFI: RSI OB (Overbought), RSI OS (Oversold), MFI OB, MFI OS, along with the exact value.
 Important: The labels remain on the chart as long as the condition holds (indicator is above/below the level), unlike alerts which mark a singular crossover event.
 
 Plotting of Key Values: 
 
 The indicator plots six invisible series on the chart, primarily to allow the user to view the exact numerical values of:
- The upper and lower bounds of the External Range (External High, External Low).
- The upper and lower bounds of the Internal Range (Internal High, Internal Low).
- The calculated RSI and MFI values (RSI, MFI).
 These values are accessible for viewing through TradingView's Data Window and also via the Status Line when hovering over the relevant candle. This enables more precise quantitative analysis of range levels and momentum.
 
 6. Comprehensive Breakout Alerts 
The "Range Breakout  " indicator provides 12 distinct alert conditions for breakouts, allowing you to select the required level of confirmation for each alert. All alerts are triggered only upon a fully confirmed bar close (barstate.isconfirmed) to minimize false signals and ensure reliability.
All breakout alerts are configured to detect a Crossover/Crossunder of the levels, meaning a specific event where the price moves from one side of the range to the other.
 
 External Range Breakout UP
- Close: Price closes above the External Range.
- Real Body: The entire "real body" of the candle (min of open/close prices) closes above the External Range.
- Full Candle: The entire candle (the lowest point of the candle) closes above the External Range.
 External Range Breakout DOWN
- Close: Price closes below the External Range.
- Real Body: The entire "real body" of the candle (max of open/close prices) closes below the External Range.
- Full Candle: The entire candle (the highest point of the candle) closes below the External Range.
 Internal Range Breakout UP
- Close: Price closes above the Internal Range.
- Real Body: The "real body" of the candle closes above the Internal Range.
- Full Candle: The entire candle closes above the Internal Range.
 Internal Range Breakout DOWN
- Close: Price closes below the Internal Range.
- Real Body: The "real body" of the candle closes below the Internal Range.
- Full Candle: The entire candle closes below the Internal Range.
 
 7. Ideal Use Cases 
This indicator is ideal for traders who:
 
 Want to clearly identify and monitor price consolidation zones.
 Seek confirmation for breakout strategies across various timeframes.
 Require reliable and automated alerts for potential entry or exit points based on range expansion.
 
 8. Complementary Indicator 
For even more comprehensive market analysis, we highly recommend using this indicator in conjunction with  Market Structure Support & Resistance External/Internal & BoS  .
This powerful complementary indicator automatically and accurately identifies significant support and resistance levels by locating high and low pivot points, as well as key Pre-Market High/Low levels. Its strength lies in its dynamic adaptability to any timeframe and asset, providing precise and relevant real-time levels while maintaining a clean chart. It also identifies Break of Structure (BoS) to signal potential trend changes or continuations.
Using both indicators together provides a robust framework for identifying defined ranges and potential trend shifts, enabling more informed trading decisions.
 View Market Structure Support & Resistance External/Internal & BoS   Indicator 
 9. Important Note: Trading Risk 
This indicator is intended for educational and informational purposes only and does not constitute investment advice or a recommendation for trading in any form whatsoever.
Trading in financial markets involves significant risk of capital loss. It is important to remember that past performance is not indicative of future results. All trading decisions are your sole responsibility. Never trade with money you cannot afford to lose.
Better MACD📘 Better MACD – Adaptive Momentum & Divergence Suite
Better MACD is a comprehensive momentum-trend tool that evolves the traditional MACD into a multi-dimensional, divergence-aware oscillator. It leverages exponential smoothing across logarithmic rate-of-change of OHLC data, adaptive signal processing, and intelligent divergence detection logic to provide traders with earlier, smoother, and more reliable momentum signals.
This indicator is built for professional-level analysis, suitable for scalping, swing trading, and trend-following systems.
🧬 Core Concept
Unlike the classic MACD which subtracts two EMAs of price, Better MACD constructs a signal by:
Applying logarithmic transformation on the change between OHLC components (Close, High, Low, Open).
Using double EMA smoothing to filter noise and volatility, Triangular method. 1st to 2nd Smoothing.
Averaging and de-biasing the results through a custom linear regression model, 4th Smoothing.
Subtracting a fast SMA and slow SMA response to yield a dynamic MACD value, 3rd Smoothing.
The result is a smooth, adaptive, and high-resolution MACD-style oscillator that responds more naturally to trend conditions and price geometry.
🧠 Features Breakdown
1. 📈 Multi-Layer MACD Engine
Src1: Smoothed Log Rate-of-Change on Close
Src2: Smoothed Log Rate-of-Change on High
Src3: Smoothed Log Rate-of-Change on Low
Src4: Smoothed Log Rate-of-Change on Open
These are blended using highest high, lowest low, and average Close price over a configurable window for more complete trend detection. The open-based Src4 is subtracted using SMA.
2. 🧮 Signal Line
A fast EMA (signalLength) of the Better MACD value is used for crossover logic.
Crossovers of MACD and Signal line signal potential entries or exits.
3. 📊 MACD Histogram
Visualizes the difference between MACD and Signal line.
Dynamically color-coded:
Green/Light Green for bullish impulse
Red/Pink for bearish impulse
Width and color intensity reflect strength and momentum slope.
🎨 Visual Enhancements
Feature	Description
✅ Ribbon Fill	Optional fill between MACD and Signal line, colored by trend direction
✅ Zero-Line Background	Background highlights above/below 0 to easily read bullish/bearish bias
✅ Crossover Highlights	Tiny circles plotted when MACD crosses Signal line
🔍 Divergence Detection Suite
The script includes a full Divergence Engine to detect:
🔼 Bullish Regular Divergence (Price lower lows + Indicator higher lows)
🔽 Bearish Regular Divergence (Price higher highs + Indicator lower highs)
🟢 Bullish Hidden Divergence (Price higher lows + Indicator lower lows)
🔴 Bearish Hidden Divergence (Price lower highs + Indicator higher highs)
🧩 Divergence Modes:
Supports both Regular, Hidden, or Both simultaneously
Detects from either Close Price or Heikin Ashi-derived candles
Uses dynamic pivot tracking with configurable lookback and divergence sensitivity
Divergence lines are labeled, colored, and plotted in real-time
🔁 Styling & Customization:
Choose from Solid, Dashed, or Dotted line styles
Configure separate colors and widths for all divergence types
Control number of divergence lines visible or only show the most recent
Divergences update live without repainting
⚠️ Alerts
Alerts are built-in for real-time notification:
MACD Histogram reversals (rising → falling, or vice versa)
Divergence signals (all 4 types, grouped and individually)
Combines seamlessly with TradingView alerts for actionable triggers
🔧 Input Controls (Grouped by Purpose)
Better MACD Group
1st–4th Smoothing Lengths: Controls responsiveness of MACD core engine
Signal Length: Smoothness of signal line
Toggles for crossover highlights, zero cross fills, and ribbon fills
Divergence Settings
Enable/disable divergence lines
Choose divergence type (Regular, Hidden, Both)
Set confirmation requirements
Customize pivot detection and bar search depth
Styling Options
Colors, line widths, and line styles for each divergence type
Heikin Ashi Mode for smoother pivots and divergences
🧠 How to Use
✅ For Trend Traders:
Use MACD > Signal + Histogram > 0 → Bullish confirmation
MACD < Signal + Histogram < 0 → Bearish confirmation
Wait for pullbacks with hidden divergences to enter in trend direction
✅ For Reversal Traders:
Look for Regular Divergences at trend exhaustion points
Combine with price action (e.g., support/resistance or candle pattern)
✅ For Swing & Day Traders:
Enable Heikin Ashi Mode for smoother divergence pivots
Use zero line background + histogram color to time entries
📌 Summary
Feature	Description
🚀 Advanced MACD Core	Smoother, more reliable, multi-source-based MACD
🔍 Divergence Engine	Detects 4 divergence types with pivot logic
🎯 Real-Time Alerts	Alerts for histogram slope and divergences
🎛️ Deep Customization	Full styling, smoothing, and detection controls
📉 Heikin Ashi Support	Improved signal quality in trend-based markets
KST Strategy [Skyrexio]Overview 
KST Strategy   leverages Know Sure Thing (KST) indicator in conjunction with the Williams Alligator and Moving average to obtain the high probability setups. KST is used for for having the high probability to enter in the direction of a current trend when momentum is rising, Alligator is used as a short term trend filter, while Moving average approximates the long term trend and allows trades only in its direction. Also strategy has the additional optional filter on Choppiness Index which does not allow trades if market is choppy, above the user-specified threshold. Strategy has the user specified take profit and stop-loss numbers, but multiplied by Average True Range (ATR) value on the moment when trade is open. The strategy opens only long trades.
 Unique Features 
 
 ATR based stop-loss and take profit.  Instead of fixed take profit and stop-loss percentage strategy utilizes user chosen numbers multiplied by ATR for its calculation.
 Configurable Trading Periods.  Users can tailor the strategy to specific market windows, adapting to different market conditions.
 Optional Choppiness Index filter.  Strategy allows to choose if it will use the filter trades with Choppiness Index and set up its threshold.
 
 Methodology 
The strategy opens long trade when the following price met the conditions:
 
 Close price is above the Alligator's jaw line
 Close price is above the filtering Moving average
 KST line of Know Sure Thing indicator shall cross over its signal line (details in justification of methodology)
 If the Choppiness Index filter is enabled its value shall be less than user defined threshold
 
When the long trade is executed algorithm defines the stop-loss level as the low minus user defined number, multiplied by ATR at the trade open candle. Also it defines take profit with close price plus user defined number, multiplied by ATR at the trade open candle. While trade is in progress, if high price on any candle above the calculated take profit level or low price is below the calculated stop loss level, trade is closed.
 Strategy settings 
In the inputs window user can setup the following strategy settings:
 
 ATR Stop Loss  (by default = 1.5, number of ATRs to calculate stop-loss level)
 ATR Take Profit  (by default = 3.5, number of ATRs to calculate take profit level)
 Filter MA Type  (by default = Least Squares MA, type of moving average which is used for filter MA)
 Filter MA Length  (by default = 200, length for filter MA calculation)
 Enable Choppiness Index Filter  (by default = true, setting to choose the optional filtering using Choppiness index)
 Choppiness Index Threshold  (by default = 50, Choppiness Index threshold, its value shall be below it to allow trades execution)
 Choppiness Index Length  (by default = 14, length used in Choppiness index calculation)
 KST ROC Length #1  (by default = 10, value used in KST indicator calculation, more information in Justification of Methodology)
 KST ROC Length #2  (by default = 15, value used in KST indicator calculation, more information in Justification of Methodology)
 KST ROC Length #3  (by default = 20, value used in KST indicator calculation, more information in Justification of Methodology)
 KST ROC Length #4  (by default = 30, value used in KST indicator calculation, more information in Justification of Methodology)
 KST SMA Length #1  (by default = 10, value used in KST indicator calculation, more information in Justification of Methodology)
 KST SMA Length #2  (by default = 10, value used in KST indicator calculation, more information in Justification of Methodology)
 KST SMA Length #3  (by default = 10, value used in KST indicator calculation, more information in Justification of Methodology)
 KST SMA Length #4  (by default = 15, value used in KST indicator calculation, more information in Justification of Methodology)
 KST Signal Line Length  (by default = 10, value used in KST indicator calculation, more information in Justification of Methodology)
 
User can choose the optimal parameters during backtesting on certain price chart.
 Justification of Methodology 
Before understanding why this particular combination of indicator has been chosen let's briefly explain what is KST, Williams Alligator, Moving Average, ATR and Choppiness Index.
The KST (Know Sure Thing) is a momentum oscillator developed by Martin Pring. It combines multiple Rate of Change (ROC) values, smoothed over different timeframes, to identify trend direction and momentum strength. First of all, what is ROC? ROC (Rate of Change) is a momentum indicator that measures the percentage change in price between the current price and the price a set number of periods ago.
 ROC = 100 * (Current Price - Price N Periods Ago) / Price N Periods Ago 
In our case N is the KST ROC Length inputs from settings, here we will calculate 4 different ROCs to obtain KST value:
 KST = ROC1_smooth × 1 + ROC2_smooth × 2 + ROC3_smooth × 3 + ROC4_smooth × 4 
 ROC1 = ROC(close, KST ROC Length #1), smoothed by KST SMA Length #1,
ROC2 = ROC(close, KST ROC Length #2), smoothed by KST SMA Length #2,
ROC3 = ROC(close, KST ROC Length #3), smoothed by KST SMA Length #3,
ROC4 = ROC(close, KST ROC Length #4), smoothed by KST SMA Length #4 
Also for this indicator the signal line is calculated:
 Signal = SMA(KST, KST Signal Line Length) 
When the KST line rises, it indicates increasing momentum and suggests that an upward trend may be developing. Conversely, when the KST line declines, it reflects weakening momentum and a potential downward trend. A crossover of the KST line above its signal line is considered a buy signal, while a crossover below the signal line is viewed as a sell signal. If the KST stays above zero, it indicates overall bullish momentum; if it remains below zero, it points to bearish momentum. The KST indicator smooths momentum across multiple timeframes, helping to reduce noise and provide clearer signals for medium- to long-term trends.
Next, let’s discuss the short-term trend filter, which combines the Williams Alligator and Williams Fractals. Williams Alligator
Developed by Bill Williams, the Alligator is a technical indicator that identifies trends and potential market reversals. It consists of three smoothed moving averages:
 
 Jaw (Blue Line):  The slowest of the three, based on a 13-period smoothed moving average shifted 8 bars ahead.
 Teeth (Red Line):  The medium-speed line, derived from an 8-period smoothed moving average shifted 5 bars forward.
 Lips (Green Line):  The fastest line, calculated using a 5-period smoothed moving average shifted 3 bars forward.
 
When the lines diverge and align in order, the "Alligator" is "awake," signaling a strong trend. When the lines overlap or intertwine, the "Alligator" is "asleep," indicating a range-bound or sideways market. This indicator helps traders determine when to enter or avoid trades.
The next indicator is Moving Average. It has a lot of different types which can be chosen to filter trades and the Least Squares MA is used by default settings. Let's briefly explain what is it.
The Least Squares Moving Average (LSMA) — also known as Linear Regression Moving Average — is a trend-following indicator that uses the least squares method to fit a straight line to the price data over a given period, then plots the value of that line at the most recent point. It draws the best-fitting straight line through the past N prices (using linear regression), and then takes the endpoint of that line as the value of the moving average for that bar. The LSMA aims to reduce lag and highlight the current trend more accurately than traditional moving averages like SMA or EMA.
Key Features:
 
 It reacts faster to price changes than most moving averages.
 It is smoother and less noisy than short-term EMAs.
 It can be used to identify trend direction, momentum, and potential reversal points.
 
ATR (Average True Range) is a volatility indicator that measures how much an asset typically moves during a given period. It was introduced by J. Welles Wilder and is widely used to assess market volatility, not direction.
To calculate it first of all we need to get True Range (TR), this is the greatest value among:
 
 High - Low
 abs(High - Previous Close)
 abs(Low - Previous Close)
 
 ATR = MA(TR, n) , where n is number of periods for moving average, in our case equals 14.
ATR shows how much an asset moves on average per candle/bar. A higher ATR means more volatility; a lower ATR means a calmer market.
The Choppiness Index is a technical indicator that quantifies whether the market is trending or choppy (sideways). It doesn't indicate trend direction — only the strength or weakness of a trend. Higher Choppiness Index usually approximates the sideways market, while its low value tells us that there is a high probability of a trend.
 Choppiness Index = 100 × log10(ΣATR(n) / (MaxHigh(n) - MinLow(n))) / log10(n) 
where:
 
 ΣATR(n)  = sum of the Average True Range over n periods
 MaxHigh(n)  = highest high over n periods
 MinLow(n)  = lowest low over n periods
 log10  = base-10 logarithm
 
Now let's understand how these indicators work in conjunction and why they were chosen for this strategy. KST indicator approximates current momentum, when it is rising and KST line crosses over the signal line there is high probability that short term trend is reversing to the upside and strategy allows to take part in this potential move. Alligator's jaw (blue) line is used as an approximation of a short term trend, taking trades only above it we want to avoid trading against trend to increase probability that long trade is going to be winning.
Almost the same for Moving Average, but it approximates the long term trend, this is just the additional filter. If we trade in the direction of the long term trend we increase probability that higher risk to reward trade will hit the take profit. Choppiness index is the optional filter, but if it turned on it is used for approximating if now market is in sideways or in trend. On the range bounded market the potential moves are restricted. We want to decrease probability opening trades in such condition avoiding trades if this index is above threshold value.
When trade is open script sets the stop loss and take profit targets. ATR approximates the current volatility, so we can make a decision when to exit a trade based on current market condition, it can increase the probability that strategy will avoid the excessive stop loss hits, but anyway user can setup how many ATRs to use as a stop loss and take profit target. As was said in the Methodology stop loss level is obtained by subtracting number of ATRs from trade opening candle low, while take profit by adding to this candle's close.
 Backtest Results 
 
 Operating window:  Date range of backtests is 2023.01.01 - 2025.05.01. It is chosen to let the strategy to close all opened positions.
 Commission and Slippage:  Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
 Initial capital:  10000 USDT
 Percent of capital used in every trade:  60%
 Maximum Single Position Loss:  -5.53%
 Maximum Single Profit:  +8.35%
 Net Profit:  +5175.20 USDT (+51.75%)
 Total Trades:  120 (56.67% win rate)
 Profit Factor:  1.747
 Maximum Accumulated Loss:  1039.89 USDT (-9.1%)
 Average Profit per Trade:  43.13 USDT (+0.6%)
 Average Trade Duration:  27 hours
 
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
 How to Use 
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 1h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
 Disclaimer: 
Educational and informational tool reflecting Skyrexio commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation.
cd_secret_candlestick_patterns_CxHi traders, 
With this indicator, we aim to uncover secret candlestick formations that even advanced traders may miss—especially those that can't be detected by classic pattern indicators, unless you're a true master of candlestick patterns or candle math.
________________________________________
 General Idea: 
We'll try to identify candlestick patterns by regrouping candles into custom-sized segments that you define.
You might ask: “Why do I need this? I can just look at different timeframes and spot the structure anyway.” But it’s not the same.
For example, if you're using a 1-minute chart and add a higher-timeframe candle overlay (like 5-minute), the candles you see start at fixed timestamps like 0, 5, 10, etc.
However, in this indicator, we redraw new candles by grouping them from the current candle backward in batches of five.
These candles won't match the standard view—only when aligned with exact time multiples (e.g., 0 and 5 minutes) will they look the same.
In classic charts:
•	You see 5-minute candles that begin every 0 and 5 minutes.
In this tool:
•	You see a continuously updating set of 5 merged 1-minute candles redrawn every minute.
What about the structures forming in between those fixed timeframes?
That’s exactly what we’ll be able to detect—while also making the lower timeframe chart more readable.
________________________________________
 Candle Merging: 
Let’s continue with an example.
Assume we choose to merge 5 candles. Then the new candle will be formed using:
open  = open 
close = close 
high  = math.max(high , high , high , high , high)
low   = math.min(low , low , low , low , low)
This logic continues backward on the chart, creating merged candles in groups of 5.
Since the selected patterns are made up of 3, 4, or 5 candles, we redraw 5 such merged candles to analyze.
________________________________________
 Which Patterns Are Included? 
A total of 18 bullish and bearish patterns are included.
You’ll find both widely known formations and a few personal ones I use, marked as (MeReT).
You can find the pattern list and visual reference here:
  
________________________________________
 Entry and Filtering Suggestions: 
Let me say this clearly:
Entering a trade every time a pattern forms will not make you profitable in the long run.
You need a clear trade plan and should only act when you can answer questions like:
•	Where did the pattern appear?
•	When and under what conditions?
It’s more effective to trade in the direction of the trend and look for setups around support/resistance, supply/demand zones, key levels, or areas confirmed by other indicators.
Whether you enter immediately after the pattern or wait for a retest is a personal choice—but risk management is non-negotiable.
One of the optional filters I’ve included is a Higher Timeframe (HTF) condition, which is my personal preference:
When enabled, the highest or lowest price among the pattern candles must match the high or low of the current HTF candle.
You can see in the image below the decrease in the number of detected patterns on the 1-minute chart when using no filter (blue labels) compared to when the 1-hour timeframe filter is applied (red labels).
  
Additionally, I’ve added a “protected” condition for engulfing patterns to help filter out weak classic engulf patterns.
________________________________________
 Settings: 
From the menu, you can configure:
•	Number of candles for regrouping
•	Distance between the last candle and newly drawn candles
•	Show/hide options
•	HTF filter toggle and timeframe selection
•	Color, label placement, and text customization
•	Pattern list (select which to display or trigger alerts for)
My preferred setup:
While trading on the 1-minute chart, I typically set the higher timeframe to 15m or 1H, and switch the candle count between 2 and 3 depending on the situation.
⚠️ Important note:
The “Show” and “Alert” options are controlled by a single command.
Alerts are automatically created for any pattern you choose to display.
________________________________________
 What’s Next? 
In future updates, I plan to add:
•	Pattern success rate statistics
•	Multi-broker confirmation for pattern validation
Lastly, keep in mind:
The more candles a pattern is based on, the more reliable it may be.
I'd love to hear your feedback and suggestions.
Cheerful trading! 🕊️📈
Share SizePurpose: The "Share Size" indicator is a powerful risk management tool designed to help traders quickly determine appropriate share/contract sizes based on their predefined risk per trade and the current market's volatility (measured by ATR). It calculates potential dollar differences from recent highs/lows and translates them into a recommended share/contract size, accounting for a user-defined ATR-based offset. This helps you maintain consistent risk exposure across different instruments and market conditions.
How It Works: At its core, the indicator aims to answer the question: "How many shares/contracts can I trade to keep my dollar risk within limits if my stop loss is placed at a recent high or low, plus an ATR-based buffer?"
Price Difference Calculation: It first calculates the dollar difference between the current close price and the high and low of the current bar (Now) and the previous 5 bars (1 to 5).
Tick Size & Value Conversion: These price differences are then converted into dollar values using the instrument's specific tickSize and tickValue. You can select common futures contracts (MNQ, MES, MGC, MCL), a generic "Stock" setting, or define custom values.
ATR Offset: An Average True Range (ATR) based offset is added to these dollar differences. This offset acts as a buffer, simulating a stop loss placed beyond the immediate high/low, accounting for market noise or volatility.
Risk-Based Share Size: Finally, using your Default Risk ($) input, the indicator calculates how many shares/contracts you can take for each of the 6 high/low scenarios (current bar, 5 previous bars) to ensure your dollar risk per trade remains constant.
Dynamic Table: All these calculations are presented in a clear, real-time table at the bottom-left of your chart. The table dynamically adjusts its "Label" to show the selected symbol preset, making it easy to see which instrument's settings are currently being used. The "Shares" rows indicate the maximum shares/contracts you can trade for a given risk and stop placement. The cells corresponding to the largest dollar difference (and thus smallest share size) for both high and low scenarios are highlighted, drawing your attention to the most conservative entry points.
Key Benefits:
Consistent Risk: Helps maintain a consistent dollar risk per trade, regardless of the instrument or its current price/volatility.
Dynamic Sizing: Automatically adjusts share/contract size based on market volatility and your chosen stop placement.
Quick Reference: Provides a real-time, easy-to-read table directly on your chart, eliminating manual calculations.
Informed Decision Making: Assists in quickly assessing trade opportunities and potential position sizes.
Setup Parameters (Inputs)
When you add the "Share Size" indicator to your chart, you'll see a settings dialog with the following parameters:
1. Symbol Preset:
Purpose: This is the primary setting to define the tick size and value for your chosen trading instrument.
Options:
MNQ (Micro Nasdaq 100 Futures)
MES (Micro E-mini S&P 500 Futures)
MGC (Micro Gold Futures)
MCL (Micro Crude Oil Futures)
Stock (Generic stock setting, with tick size/value of 0.01)
Custom (Allows you to manually input tick size and value)
Default: MNQ
Importance: Crucial for accurate dollar calculations. Ensure this matches the instrument you are trading.
2. Tick Size (Manual Override):
Purpose: Only used if Symbol Preset is set to Custom. This defines the smallest price increment for your instrument.
Type: Float
Default: 0.25
Hidden: This input is hidden (display=display.none) unless "Custom" is selected. You might need to change display=display.none to display=display.inline in the code if you want to see and adjust it directly in the settings for "Custom" mode.
3. Tick Value (Manual Override):
Purpose: Only used if Symbol Preset is set to Custom. This defines the dollar value of one tickSize increment.
Type: Float
Default: 0.50
Hidden: This input is hidden (display=display.none) unless "Custom" is selected. Similar to Tick Size, you might need to adjust its display property if you want it visible.
4. Default Risk ($):
Purpose: This is your maximum desired dollar risk per trade. All share size calculations will be based on this value.
Type: Float
Default: 50.0
Hidden: This input is hidden (display=display.none). It's a critical setting, so consider making it visible by changing display=display.none to display=display.inline in the code if you want users to easily adjust their risk.
ATR Offset Settings (Group): This group of settings allows you to fine-tune the ATR-based buffer added to your potential stop loss.
5. ATR Offset Length:
Purpose: Defines the lookback period for the Average True Range (ATR) calculation used for the offset.
Type: Integer
Default: 7
Hidden: This input is hidden (display=display.none).
6. ATR Offset Timeframe:
Purpose: Specifies the timeframe on which the ATR for the offset will be calculated. This allows you to use ATR from a higher timeframe for your stop buffer, even if your chart is on a lower timeframe.
Type: Timeframe string (e.g., "1" for 1 minute, "60" for 1 hour, "D" for Daily)
Default: "1" (1 Minute)
Hidden: This input is hidden (display=display.none).
7. ATR Offset Multiplier (x ATR):
Purpose: Multiplies the calculated ATR value to determine the final dollar offset added to your high/low price difference. A value of 1.0 means one full ATR is added. A value of 0.5 means half an ATR is added.
Type: Float
Minimum Value: 0 (no offset)
Default: 1.0
Hidden: This input is hidden (display=display.none).
HMA Swing Levels [BigBeluga]An advanced swing structure and trend-following tool built on Hull Moving Average logic, designed to detect major reversals and track dynamic support/resistance zones. 
This indicator analyzes price swings using pivot highs/lows and a smoothed HMA trend baseline. It highlights key reversal levels and keeps them active until breached, giving traders a clear visual framework for price structure and trend alignment. The pivots are calculated in real-time using non-lagging logic, making them highly responsive to market conditions.
 🔵 CONCEPTS 
 
  Combines a fast-reacting  Hull Moving Average (HMA)  with pivot logic to capture precise directional changes.
  Detects  non-lagging reversal highs and lows  when pivot points form and the HMA direction flips.
  Projects these reversal levels forward as  horizontal support/resistance lines  until broken by price.
  Active trend is shown with a  step-style trail line  that reflects HMA bias over time.
 
 🔵 FEATURES 
 
   Swing Level Detection: 
Identifies high/low reversals when trend direction changes and plots horizontal zones.
  
Non-lagging logic of swing points detection:
 
if h  == high  and high < h and change > 0
    // Detected Swing High
if l  == low  and low > l and change < 0
    // Detected Swing Low
 
  
   Persistent Support & Resistance Lines: 
Each detected swing high or low is extended forward until price invalidates the level. Dotted style is applied once breached.
   Color-Coded Trend Trail: 
Displays a stepped trend trail using HMA slope: lime = uptrend, blue = downtrend.
  
   Automatic Labeling: 
Each reversal level is labeled with its price for clear reference.
  
   Age-Based Line Thickness: 
Every level increases in thickness every 250 bars. The longer the level lasts, the stronger it is.
  
 
 🔵 HOW TO USE 
 
  Use green (support) and blue (resistance) levels to frame key reaction zones.
  
  Trade with the trend defined by the trail color: lime for bullish bias, blue for bearish.
  Explore where buy or sell orders are stacked
  
  Look for breaks of swing lines to anticipate trend shifts or breakout setups.
  Adjust the  "Trend Change"  input to tune the sensitivity of swing detection.
  Adjust the  "SwingLevels"  input to define how far back to search for valid pivots.
 
 🔵 CONCLUSION 
 HMA Swing Levels   offers a hybrid approach to structural and trend-based trading. With automated  non-lagging  swing detection, persistent support/resistance tracking, and intuitive HMA-based trend coloring, it provides a powerful visual system for discretionary and systematic traders alike.
cd_cisd_market_CxHi Traders,
Overview: 
Many traders follow market structure to identify the market direction and seek trade opportunities in line with the trend.
However, markings derived from user-defined inputs can create different structures, depending on personal choices. For instance, choosing a pivot distance of 3 instead of 2 alters the structure, even though the chart remains the same. Ideally, the structure should remain consistent.
"Change in State Delivery" ( CISD ) is a widely accepted concept among traders and is considered a significant indicator of market direction based on the gain/loss of CISD levels.
In this indicator, CISD is selected as the primary criterion for marking market structure, eliminating the influence of user-dependent variations.
Here is a summary of the key logic and rules applied:
•	When the price forms a new high/low, that level is only considered a pivot if a CISD has occurred.
•	A bullish CISD is always followed by a bearish CISD, and vice versa.
•	Pivot points form the internal structure.
•	The internal structure is used to interpret the swing structure.
•	Probabilities are derived from internal structure patterns.
________________________________________
 Details: 
 How is CISD determined? 
As is commonly known:
•	When price makes a new high, the opening level of the first candle in the consecutive bullish candle sequence is marked.
•	When price makes a new low, the opening of the first candle in the consecutive bearish sequence is marked.
•	If there’s only one candle in the sequence, its opening level is used.
In a bullish market, losing a bearish CISD level (i.e., a close below it) or in a bearish market, gaining a bullish CISD level (i.e., a close above it) is interpreted as a potential shift in buyer-seller dominance and a possible market reversal.
________________________________________
 How are internal (pivot) levels determined? 
•	When price closes below a bearish CISD level, the highest candle's high becomes a pivot high (PH).
•	When price closes above a bullish CISD level, the lowest candle's low becomes a pivot low (PL).
•	If the new PH is above the previous PH, it’s labeled as HH (Higher High); otherwise, LH (Lower High).
•	If the new PL is below the previous PL, it’s labeled as LL (Lower Low); otherwise, HL (Higher Low).
________________________________________
 Internal Market Structure: 
•	A series of HHs indicates a bullish internal structure.
•	A series of LLs indicates a bearish internal structure.
________________________________________
 Swing (Main) Market Structure: 
Using internal pivots and previous swing levels, the main market structure is derived.
•	A new swing high (SH) requires the price to move above the previous SH.
•	A new swing low (SL) requires the price to move below the previous SL.
________________________________________
 Probability Calculation: 
Pivot levels forming the internal structure are coded as five-element sequences.
There are 64 possible combinations of such sequences made from consecutive PH and PL values.
Each pattern’s frequency from its starting candle is tracked.
To make it more understandable:
For example, after the four-sequence “HH, LL, LH,HL”, either HH or LH might follow.
The table shows the statistical likelihood of both possible outcomes for the most recent four-element sequence on the chart.
________________________________________
 How reliable is it? 
To assess reliability, results are calculated from the beginning using:
Success Rate (Suc. Rt) = Number of Correct Predictions / Total Predictions
This value is added to the table for reference.
It’s important to note that no statistical outcome guarantees certainty—every result offers a different interpretation. What truly matters is to avoid getting stopped out 😊.
________________________________________
 Menu Options: 
Show/hide preferences and color selections can be customized via the indicator menu.
________________________________________
 What’s Coming in Future Versions? 
Features such as FVG (Fair Value Gaps) between swing levels, volume imbalances, order blocks / mitigation blocks, Fibonacci levels, and relevant trade suggestions will be added.
________________________________________
This is a  BETA  version that I believe will help simplify your market reading. I’d be happy to hear your feedback and suggestions.
 Cheerful Trading! 
Langlands-Operadic Möbius Vortex (LOMV)Langlands-Operadic Möbius Vortex (LOMV) 
 Where Pure Mathematics Meets Market Reality 
 A Revolutionary Synthesis of Number Theory, Category Theory, and Market Dynamics 
 🎓 THEORETICAL FOUNDATION 
The Langlands-Operadic Möbius Vortex represents a groundbreaking fusion of three profound mathematical frameworks that have never before been combined for market analysis:
 The Langlands Program: Harmonic Analysis in Markets 
Developed by Robert Langlands (Fields Medal recipient), the Langlands Program creates bridges between number theory, algebraic geometry, and harmonic analysis. In our indicator:
 L-Function Implementation: 
- Utilizes the Möbius function μ(n) for weighted price analysis
- Applies Riemann zeta function convergence principles  
- Calculates quantum harmonic resonance between -2 and +2
- Measures deep mathematical patterns invisible to traditional analysis
The L-Function core calculation employs:
L_sum = Σ(return_val × μ(n) × n^(-s))
Where s is the critical strip parameter (0.5-2.5), controlling mathematical precision and signal smoothness.
 Operadic Composition Theory: Multi-Strategy Democracy 
Category theory and operads provide the mathematical framework for composing multiple trading strategies into a unified signal. This isn't simple averaging - it's mathematical composition using:
 Strategy Composition Arity (2-5 strategies): 
- Momentum analysis via RSI transformation
- Mean reversion through Bollinger Band mathematics  
- Order Flow Polarity Index (revolutionary T3-smoothed volume analysis)
- Trend detection using Directional Movement
- Higher timeframe momentum confirmation
 Agreement Threshold System:  Democratic voting where strategies must reach consensus before signal generation. This prevents false signals during market uncertainty.
 Möbius Function: Number Theory in Action 
The Möbius function μ(n) forms the mathematical backbone:
- μ(n) = 1 if n is a square-free positive integer with even number of prime factors
- μ(n) = -1 if n is a square-free positive integer with odd number of prime factors  
- μ(n) = 0 if n has a squared prime factor
This creates oscillating weights that reveal hidden market periodicities and harmonic structures.
 🔧 COMPREHENSIVE INPUT SYSTEM 
 Langlands Program Parameters 
 Modular Level N (5-50, default 30): 
Primary lookback for quantum harmonic analysis. Optimized by timeframe:
- Scalping (1-5min): 15-25
- Day Trading (15min-1H): 25-35  
- Swing Trading (4H-1D): 35-50
- Asset-specific: Crypto 15-25, Stocks 30-40, Forex 35-45
 L-Function Critical Strip (0.5-2.5, default 1.5): 
Controls Riemann zeta convergence precision:
- Higher values: More stable, smoother signals
- Lower values: More reactive, catches quick moves
- High frequency: 0.8-1.2, Medium: 1.3-1.7, Low: 1.8-2.3
 Frobenius Trace Period (5-50, default 21): 
Galois representation lookback for price-volume correlation:
- Measures harmonic relationships in market flows
- Scalping: 8-15, Day Trading: 18-25, Swing: 25-40
 HTF Multi-Scale Analysis: 
Higher timeframe context prevents trading against major trends:
- Provides market bias and filters signals
- Improves win rates by 15-25% through trend alignment
 Operadic Composition Parameters 
 Strategy Composition Arity (2-5, default 4): 
Number of algorithms composed for final signal:
- Conservative: 4-5 strategies (higher confidence)
- Moderate: 3-4 strategies (balanced approach)
- Aggressive: 2-3 strategies (more frequent signals)
 Category Agreement Threshold (2-5, default 3): 
Democratic voting minimum for signal generation:
- Higher agreement: Fewer but higher quality signals
- Lower agreement: More signals, potential false positives
 Swiss-Cheese Mixing (0.1-0.5, default 0.382): 
Golden ratio φ⁻¹ based blending of trend factors:
- 0.382 is φ⁻¹, optimal for natural market fractals
- Higher values: Stronger trend following
- Lower values: More contrarian signals
 OFPI Configuration: 
-  OFPI Length (5-30, default 14):  Order Flow calculation period
-  T3 Smoothing (3-10, default 5):  Advanced exponential smoothing
-  T3 Volume Factor (0.5-1.0, default 0.7):  Smoothing aggressiveness control
 Unified Scoring System 
 Component Weights (sum ≈ 1.0): 
-  L-Function Weight (0.1-0.5, default 0.3):  Mathematical harmony emphasis
-  Galois Rank Weight (0.1-0.5, default 0.2):  Market structure complexity
-  Operadic Weight (0.1-0.5, default 0.3):  Multi-strategy consensus
-  Correspondence Weight (0.1-0.5, default 0.2):  Theory-practice alignment
 Signal Threshold (0.5-10.0, default 5.0): 
Quality filter producing:
- 8.0+: EXCEPTIONAL signals only
- 6.0-7.9: STRONG signals  
- 4.0-5.9: MODERATE signals
- 2.0-3.9: WEAK signals
 🎨 ADVANCED VISUAL SYSTEM 
 Multi-Dimensional Quantum Aura Bands 
Five-layer resonance field showing market energy:
-  Colors:  Theme-matched gradients (Quantum purple, Holographic cyan, etc.)
-  Expansion:  Dynamic based on score intensity and volatility
-  Function:  Multi-timeframe support/resistance zones
 Morphism Flow Portals 
Category theory visualization showing market topology:
-  Green/Cyan Portals:  Bullish mathematical flow
-  Red/Orange Portals:  Bearish mathematical flow  
-  Size/Intensity:  Proportional to signal strength
-  Recursion Depth (1-8):  Nested patterns for flow evolution
 Fractal Grid System 
Dynamic support/resistance with projected L-Scores:
-  Multiple Timeframes:  10, 20, 30, 40, 50-period highs/lows
-  Smart Spacing:  Prevents level overlap using ATR-based minimum distance
-  Projections:  Estimated signal scores when price reaches levels
-  Usage:  Precise entry/exit timing with mathematical confirmation
 Wick Pressure Analysis 
Rejection level prediction using candle mathematics:
-  Upper Wicks:  Selling pressure zones (purple/red lines)
-  Lower Wicks:  Buying pressure zones (purple/green lines)
-  Glow Intensity (1-8):  Visual emphasis and line reach
-  Application:  Confluence with fractal grid creates high-probability zones
 Regime Intensity Heatmap 
Background coloring showing market energy:
-  Black/Dark:  Low activity, range-bound markets
-  Purple Glow:  Building momentum and trend development
-  Bright Purple:  High activity, strong directional moves
-  Calculation:  Combines trend, momentum, volatility, and score intensity
 Six Professional Themes 
-  Quantum:  Purple/violet for general trading and mathematical focus
-  Holographic:  Cyan/magenta optimized for cryptocurrency markets
-  Crystalline:  Blue/turquoise for conservative, stability-focused trading
-  Plasma:  Gold/magenta for high-energy volatility trading
-  Cosmic Neon:  Bright neon colors for maximum visibility and aggressive trading
 📊 INSTITUTIONAL-GRADE DASHBOARD 
 Unified AI Score Section 
-  Total Score (-10 to +10):  Primary decision metric
  - >5: Strong bullish signals
  - <-5: Strong bearish signals  
  - Quality ratings: EXCEPTIONAL > STRONG > MODERATE > WEAK
-  Component Analysis:  Individual L-Function, Galois, Operadic, and Correspondence contributions
 Order Flow Analysis 
Revolutionary OFPI integration:
-  OFPI Value (-100% to +100%):  Real buying vs selling pressure
-  Visual Gauge:  Horizontal bar chart showing flow intensity
-  Momentum Status:  SHIFTING, ACCELERATING, STRONG, MODERATE, or WEAK
-  Trading Application:  Flow shifts often precede major moves
 Signal Performance Tracking 
-  Win Rate Monitoring:  Real-time success percentage with emoji indicators
-  Signal Count:  Total signals generated for frequency analysis
-  Current Position:  LONG, SHORT, or NONE with P&L tracking
-  Volatility Regime:  HIGH, MEDIUM, or LOW classification
 Market Structure Analysis 
-  Möbius Field Strength:  Mathematical field oscillation intensity
  - CHAOTIC: High complexity, use wider stops
  - STRONG: Active field, normal position sizing
  - MODERATE: Balanced conditions
  - WEAK: Low activity, consider smaller positions
-  HTF Trend:  Higher timeframe bias (BULL/BEAR/NEUTRAL)
-  Strategy Agreement:  Multi-algorithm consensus level
 Position Management 
When in trades, displays:
-  Entry Price:  Original signal price
-  Current P&L:  Real-time percentage with risk level assessment
-  Duration:  Bars in trade for timing analysis
-  Risk Level:  HIGH/MEDIUM/LOW based on current exposure
 🚀 SIGNAL GENERATION LOGIC 
 Balanced Long/Short Architecture 
The indicator generates signals through multiple convergent pathways:
 Long Entry Conditions: 
- Score threshold breach with algorithmic agreement
- Strong bullish order flow (OFPI > 0.15) with positive composite signal
- Bullish pattern recognition with mathematical confirmation
- HTF trend alignment with momentum shifting
- Extreme bullish OFPI (>0.3) with any positive score
 Short Entry Conditions: 
- Score threshold breach with bearish agreement  
- Strong bearish order flow (OFPI < -0.15) with negative composite signal
- Bearish pattern recognition with mathematical confirmation
- HTF trend alignment with momentum shifting
- Extreme bearish OFPI (<-0.3) with any negative score
 Exit Logic: 
- Score deterioration below continuation threshold
- Signal quality degradation
- Opposing order flow acceleration
- 10-bar minimum between signals prevents overtrading
 ⚙️ OPTIMIZATION GUIDELINES 
 Asset-Specific Settings 
 Cryptocurrency Trading: 
- Modular Level: 15-25 (capture volatility)
- L-Function Precision: 0.8-1.3 (reactive to price swings)
- OFPI Length: 10-20 (fast correlation shifts)
- Cascade Levels: 5-7, Theme: Holographic
 Stock Index Trading: 
- Modular Level: 25-35 (balanced trending)
- L-Function Precision: 1.5-1.8 (stable patterns)
- OFPI Length: 14-20 (standard correlation)
- Cascade Levels: 4-5, Theme: Quantum
 Forex Trading: 
- Modular Level: 35-45 (smooth trends)
- L-Function Precision: 1.6-2.1 (high smoothing)
- OFPI Length: 18-25 (disable volume amplification)
- Cascade Levels: 3-4, Theme: Crystalline
 Timeframe Optimization 
 Scalping (1-5 minute charts): 
- Reduce all lookback parameters by 30-40%
- Increase L-Function precision for noise reduction
- Enable all visual elements for maximum information
- Use Small dashboard to save screen space
 Day Trading (15 minute - 1 hour): 
- Use default parameters as starting point
- Adjust based on market volatility
- Normal dashboard provides optimal information density
- Focus on OFPI momentum shifts for entries
 Swing Trading (4 hour - Daily): 
- Increase lookback parameters by 30-50%
- Higher L-Function precision for stability
- Large dashboard for comprehensive analysis
- Emphasize HTF trend alignment
 🏆 ADVANCED TRADING STRATEGIES 
 The Mathematical Confluence Method 
1. Wait for Fractal Grid level approach
2. Confirm with projected L-Score > threshold
3. Verify OFPI alignment with direction
4. Enter on portal signal with quality ≥ STRONG
5. Exit on score deterioration or opposing flow
 The Regime Trading System 
1. Monitor Aether Flow background intensity
2. Trade aggressively during bright purple periods
3. Reduce position size during dark periods
4. Use Möbius Field strength for stop placement
5. Align with HTF trend for maximum probability
 The OFPI Momentum Strategy 
1. Watch for momentum shifting detection
2. Confirm with accelerating flow in direction
3. Enter on immediate portal signal
4. Scale out at Fibonacci levels
5. Exit on flow deceleration or reversal
 ⚠️ RISK MANAGEMENT INTEGRATION 
 Mathematical Position Sizing 
- Use Galois Rank for volatility-adjusted sizing
- Möbius Field strength determines stop width
- Fractal Dimension guides maximum exposure
- OFPI momentum affects entry timing
 Signal Quality Filtering 
- Trade only STRONG or EXCEPTIONAL quality signals
- Increase position size with higher agreement levels
- Reduce risk during CHAOTIC Möbius field periods
- Respect HTF trend alignment for directional bias
 🔬 DEVELOPMENT JOURNEY 
Creating the LOMV was an extraordinary mathematical undertaking that pushed the boundaries of what's possible in technical analysis.  This indicator almost didn't happen.  The theoretical complexity nearly proved insurmountable.
 The Mathematical Challenge 
Implementing the Langlands Program required deep research into:
- Number theory and the Möbius function
- Riemann zeta function convergence properties  
- L-function analytical continuation
- Galois representations in finite fields
The mathematical literature spans decades of pure mathematics research, requiring translation from abstract theory to practical market application.
 The Computational Complexity 
Operadic composition theory demanded:
- Category theory implementation in Pine Script
- Multi-dimensional array management for strategy composition
- Real-time democratic voting algorithms
- Performance optimization for complex calculations
 The Integration Breakthrough 
Bringing together three disparate mathematical frameworks required:
- Novel approaches to signal weighting and combination
- Revolutionary Order Flow Polarity Index development
- Advanced T3 smoothing implementation
- Balanced signal generation preventing directional bias
 Months of intensive research  culminated in breakthrough moments when the mathematics finally aligned with market reality. The result is an indicator that reveals market structure invisible to conventional analysis while maintaining practical trading utility.
 🎯 PRACTICAL IMPLEMENTATION 
 Getting Started 
1. Apply indicator with default settings
2. Select appropriate theme for your markets
3. Observe dashboard metrics during different market conditions
4. Practice signal identification without trading
5. Gradually adjust parameters based on observations
 Signal Confirmation Process 
- Never trade on score alone - verify quality rating
- Confirm OFPI alignment with intended direction  
- Check fractal grid level proximity for timing
- Ensure Möbius field strength supports position size
- Validate against HTF trend for bias confirmation
 Performance Monitoring 
- Track win rate in dashboard for strategy assessment
- Monitor component contributions for optimization
- Adjust threshold based on desired signal frequency
- Document performance across different market regimes
 🌟 UNIQUE INNOVATIONS 
1.  First Integration  of Langlands Program mathematics with practical trading
2.  Revolutionary OFPI  with T3 smoothing and momentum detection
3.  Operadic Composition  using category theory for signal democracy
4.  Dynamic Fractal Grid  with projected L-Score calculations
5.  Multi-Dimensional Visualization  through morphism flow portals
6.  Regime-Adaptive Background  showing market energy intensity
7.  Balanced Signal Generation  preventing directional bias
8.  Professional Dashboard  with institutional-grade metrics
 📚 EDUCATIONAL VALUE 
The LOMV serves as both a practical trading tool and an educational gateway to advanced mathematics. Traders gain exposure to:
- Pure mathematics applications in markets
- Category theory and operadic composition
- Number theory through Möbius function implementation  
- Harmonic analysis via L-function calculations
- Advanced signal processing through T3 smoothing
  ⚖️ RESPONSIBLE USAGE 
This indicator represents advanced mathematical research applied to market analysis. While the underlying mathematics are rigorously implemented, markets remain inherently unpredictable. 
 Key Principles: 
- Use as part of comprehensive trading strategy
- Implement proper risk management at all times
- Backtest thoroughly before live implementation
- Understand that past performance does not guarantee future results
- Never risk more than you can afford to lose
 The mathematics reveal deep market structure, but successful trading requires discipline, patience, and sound risk management beyond any indicator. 
  🔮 CONCLUSION 
The Langlands-Operadic Möbius Vortex represents a quantum leap forward in technical analysis, bringing PhD-level pure mathematics to practical trading while maintaining visual elegance and usability. 
From the harmonic analysis of the Langlands Program to the democratic composition of operadic theory, from the number-theoretic precision of the Möbius function to the revolutionary Order Flow Polarity Index, every component works in mathematical harmony to reveal the hidden order within market chaos.
 This is more than an indicator - it's a mathematical lens that transforms how you see and understand market structure. 
Trade with mathematical precision. Trade with the LOMV.
*"Mathematics is the language with which God has written the universe." - Galileo Galilei*
*In markets, as in nature, profound mathematical beauty underlies apparent chaos. The LOMV reveals this hidden order.*
— Dskyz, Trade with insight. Trade with anticipation.
Strong/Weak Candle FinderStrong/Weak Candle Finder (SWCF)
Overview:
The Strong/Weak Candle Finder (SWCF) is a versatile TradingView indicator designed to help traders identify statistically significant candles based on their size relative to recent historical price action. By analyzing a lookback period, the indicator dynamically calculates a threshold to classify candles as either "strong" (larger than the threshold) or "weak" (smaller than the threshold), providing visual cues directly on your chart.
This tool can be invaluable for traders looking to:
Spot potential momentum breakouts or high volatility (Strong Candles).
Identify periods of consolidation or low volatility (Weak Candles).
Gauge shifts in market sentiment based on candle body or range dynamics.
How It Works:
Candle Size Calculation: You choose how candle size is measured from four methods:
High - Low: The full range of the candle.
High - Close: The distance from the high to the close.
Open - Close: The size of the candle body.
Low - Open: The distance from the low to the open.
Historical Analysis: The indicator looks back over a user-defined LookBack Period to collect candle sizes.
Grouping & Precision: To smooth the distribution, candle sizes are grouped based on the Group Precision Size. This parameter divides the observed range of candle sizes into a set number of "bins," and individual candle sizes are rounded to the nearest representative value of these bins.
Percentile Threshold: A dynamic Outlier Pip Value is calculated based on the Outlier Percentile you set.
If Display Mode is "Strong Candles," this threshold represents the Nth percentile of the largest candle sizes (e.g., the 80th percentile if Outlier Percentile is 20%). Candles larger than this are marked as "Strong."
If Display Mode is "Weak Candles," this threshold represents the Nth percentile of the smallest candle sizes (e.g., the 20th percentile). Candles smaller than this are marked as "Weak."
Visual Markers: When a current candle meets the criteria (strong or weak based on your display mode), a configurable shape is plotted above (for strong) or below (for weak) the candle.
Resampling: The historical distribution and outlier threshold are recalculated every Resample Period (number of bars) to adapt to changing market conditions.
Key Features:
Dynamic Thresholds: Adapts to market volatility instead of using fixed pip values.
Customizable Candle Definition: Choose from four methods to define what "candle size" means to your strategy.
Flexible Display Modes: Focus on either identifying exceptionally strong candles or unusually weak ones.
Adjustable Sensitivity: Fine-tune the rarity of signals with Outlier Percentile and Group Precision Size.
Visual Chart Markers: Clear, customizable shapes (arrow, circle, etc.) for easy identification.
Periodic Recalculation: Ensures the indicator remains relevant as market dynamics evolve.
Parameters:
Display Mode:
Strong Candles: Highlights candles larger than the upper percentile threshold.
Weak Candles: Highlights candles smaller than the lower percentile threshold.
Resample Period (Candles): How often (in bars) to recalculate the historical distribution and outlier threshold.
LookBack Period (Candles): The number of past candles to analyze for the historical distribution. (Note: Plots will only begin after this many bars have loaded on the chart).
Group Precision Size: Number of groups to divide the candle size range into for rounding historical sizes. Higher values mean finer precision (less rounding).
Outlier Percentile (%): The percentile used to define the threshold for strong/weak candles.
Candle Size Method: (High-Low, High-Close, Open-Close, Low-Open).
Visuals:
Strong Shape: Choose the icon style for strong candles.
Weak Shape: Choose the icon style for weak candles.
Shape Size: Adjust the size of the plotted icons.
How to Use:
Strong Candles:
May indicate increased momentum, potential breakout confirmations, or high conviction moves.
Consider using in trending markets or as a filter for entry signals.
Weak Candles:
May signal market indecision, low volatility, consolidation phases, or potential exhaustion of a prior move.
Can be useful for identifying range-bound conditions or periods to be cautious.
Experimentation: Adjust the LookBack Period, Outlier Percentile, and Group Precision Size to match your trading style and the characteristics of the asset you are trading. What constitutes "strong" or "weak" can vary significantly.
Confirmation Tool: Use in conjunction with other indicators (e.g., moving averages, RSI, volume) for more robust trading decisions.
Important Notes:
The indicator requires sufficient historical data (LookBack Period) to initialize. You may not see plots on the chart immediately if there aren't enough bars loaded.
Like all indicators, the SWCF is not a standalone trading system and should not be used as the sole basis for financial decisions.
Past performance is not indicative of future results. Always use appropriate risk management.
We hope you find the Strong/Weak Candle Finder a valuable addition to your trading toolkit!
1M Scalp Setup – 2ndHi/2ndLo Breakout1M Scalp Setup – 2ndHi/2ndLo Breakout 
This script is designed for 1-minute chart scalpers seeking high-probability intraday breakout setups based on early session price action. The strategy revolves around identifying the first high and low of the day, and then detecting the second breach (2nd high or 2nd low) to anticipate breakout entries.
 🔍 Core Logic: 
 EMA Filter : A configurable EMA (default 8-period) is plotted for trend context.
 1st High/Low Detection : Captures the very first high and low of each trading day.
 2nd High/Low Markers : Identifies the second time price breaks the initial high or low, acting as a potential signal zone.
 Breakout Signals :
A  Buy Signal  is triggered when price closes above the 2nd high.
A  Sell Signal  is triggered when price closes below the 2nd low.
Each signal is  only triggered once per day  to reduce noise and avoid overtrading.
🖌️  Visual Markers: 
 1stHi and 1stLo : Early session levels (red and green).
 2ndHi and 2ndLo : Key breakout reference points (purple and blue).
 B and S Labels : Buy and Sell triggers marked in real-time once breakouts occur.
⚙️  Inputs: 
 EMA Length  (default: 8)
Customizable Colors for Buy/Sell signals and key markers
This tool is best used in fast-moving markets or during high-volume sessions. Combine with volume or higher-timeframe confirmation for improved accuracy.
Enhanced BTC Order Block IndicatorThe script you provided is an "Enhanced BTC Order Block Indicator" written in Pine Script v5 for TradingView. It is designed to identify and visually mark Order Blocks (OBs) on a Bitcoin (BTC) price chart, specifically tailored for a high-frequency scalping strategy on the 5-minute (M5) timeframe. Order Blocks are key price zones where institutional traders are likely to have placed significant buy or sell orders, making them high-probability areas for reversals or continuations. The script incorporates customizable filters, visual indicators, and alert functionality to assist traders in executing the strategy outlined earlier.
Key Features and Functionality
Purpose:
The indicator detects bullish Order Blocks (buy zones) and bearish Order Blocks (sell zones) based on a predefined percentage price movement (default 0.5–1%) and volume confirmation.
It marks these zones on the chart with colored boxes and provides alerts when an OB is detected.
User-Configurable Inputs:
Price Move Range: minMovePercent (default 0.5%) and maxMovePercent (default 1.0%) define the acceptable price movement range for identifying OBs.
Volume Threshold: volumeThreshold (default 1.5x average volume) ensures OB detection is backed by significant trading activity.
Lookback Period: lookback (default 10 candles) determines how many previous candles are analyzed to find the last candle before a strong move.
Wick/Body Option: useWick (default false) allows users to choose whether the OB zone is based on the candle’s wick or body.
Colors: bullishOBColor (default green) and bearishOBColor (default red) set the visual appearance of OB boxes.
Box Extension: boxExtension (default 100 bars) controls how far the OB box extends to the right on the chart.
RSI Filter: useRSI (default true) enables an RSI filter, with rsiLength (default 14), rsiBullishThreshold (default 50), and rsiBearishThreshold (default 50) for trend confirmation.
M15 Support/Resistance: useSR (default true) and srLookback (default 20) integrate M15 timeframe swing highs and lows for additional OB validation.
Core Logic:
Bullish OB Detection: Identifies a strong upward move (0.5–1%) with volume above the threshold. It then looks back to the last bearish candle before the move to define the OB zone. RSI > 50 and proximity to M15 support/resistance (optional) enhance confirmation.
Bearish OB Detection: Identifies a strong downward move (0.5–1%) with volume confirmation, tracing back to the last bullish candle. RSI < 50 and M15 resistance proximity (optional) add validation.
The OB zone is drawn as a rectangle from the high to low of the identified candle, extended rightward.
Visual Output:
Boxes: Uses box.new to draw OB zones, with left set to the previous bar (bar_index ), right extended by boxExtension, top and bottom defined by the OB’s high and low prices. Each box includes a text label ("Bullish OB" or "Bearish OB") and is semi-transparent.
Colors distinguish between bullish (green) and bearish (red) OBs.
Alerts:
Global alertcondition definitions trigger notifications for "Bullish OB Detected" and "Bearish OB Detected" when the respective conditions are met, displaying the current close price in the message.
Helper Functions:
f_priceChangePercent: Calculates the percentage price change between open and close prices.
isNearSR: Checks if the price is within 0.2% of M15 swing highs or lows for support/resistance confluence.
How It Works
The script runs on each candle, evaluating the current price action against the user-defined criteria.
When a bullish or bearish move is detected (meeting the percentage, volume, RSI, and S/R conditions), it identifies the preceding candle to define the OB zone.
The OB is then visualized on the chart, and an alert is triggered if configured in TradingView.
Use Case
This indicator is tailored for your BTC scalping strategy, where trades last 1–15 minutes targeting 0.3–0.5% gains. It helps traders spot institutional order zones on the M5 chart, confirmed by secondary M1 analysis, and integrates with your use of EMAs, RSI, and volume. The customizable settings allow adaptation to varying market conditions or personal preferences.
Limitations
The M15 S/R detection is simplified (using swing highs/lows), which may not always align perfectly with manual support/resistance levels.
Alerts depend on TradingView’s alert system and require manual setup.
Performance may vary with high volatility or low-volume periods, necessitating parameter adjustments.
Order Block Matrix [Alpha Extract]The Order Block Matrix indicator identifies and visualizes key supply and demand zones on your chart, helping traders recognize potential reversal points and high-probability trading setups.
This tool helps traders:
 
 Visualize key order blocks with volume profile histograms showing liquidity distribution.
 Identify high-volume price levels where institutional activity occurs.
 rank historical order blocks and analyze their strength based on volume.
 Receive alerts for potential trading opportunities based on price-block interactions.
 
🔶 CALCULATION
The indicator processes chart data to identify and analyze order blocks:
Order Block Detection
Inputs:
 
 Price action patterns (consolidation areas followed by breakouts).
 Volume data from current and lower timeframes.
 User-defined lookback periods and thresholds.
 
Detection Logic:
 
 Identifies consolidation areas using a dynamic range comparison.
 Confirms breakout patterns with percentage threshold validation.
 Maps volume distribution across price levels within each order block.
 
🔶Volume Analysis
Volume Profiling:
 
 Divides each order block into configurable grid segments.
 Maps volume distribution across price segments within blocks.
 Highlights zones with highest volume concentration.
 
Strength Assessment:
 
 Calculates total block volume and relative strength metrics.
 Compares block volume to historical averages.
 Determines probability of reversal based on volume patterns.
 
 isConsolidation(len) =>
    high_range = ta.highest(high, len) - ta.lowest(high, len)
    low_range = ta.highest(low, len) - ta.lowest(low, len)
    avg_range = (high_range + low_range) / 2
    current_range = high  - low 
    current_range <= avg_range * (1 + obThreshold) 
🔶 DETAILS
Visual Features
Volume Profile Histograms:
 
 Color-coded bars showing volume concentration within order blocks.
 Gradient coloring based on relative volume (high volume = brighter colors).
 Bull blocks (green/teal) and bear blocks (red) with varying opacity.
 
Block Visualization:
 
 Dynamic box sizing based on volume concentration.
 Optional block borders and background fills.
 Volume labels showing total block volume.
 
Screener Table:
 
 Real-time analysis of order block metrics.
 Shows block direction, proximity, retest count, and volume metrics.
 Color-coded for quick reference.
 
Interpretation
 
 High Volume Areas: Zones with institutional interest and potential reversal points.
 Block Direction: Bullish blocks typically support price, bearish blocks typically resist price.
 Retests: Multiple tests of an order block may strengthen or weaken its influence.
 Block Age: Newer blocks often have stronger influence than older ones.
 Volume Concentration: Brightest segments within blocks represent the highest volume areas.
 
🔶 EXAMPLES
The indicator helps identify key trading opportunities:
Bullish Order Blocks
 
 Support Zones: Identify strong support levels where price is likely to bounce.
 Breakout Confirmation: Validate breakouts with volume analysis to avoid false moves.
 Retest Strategies: Enter trades when price retests a bullish order block with high volume.
 
Bearish Order Blocks
 
 Resistance Zones: Identify strong resistance levels where price is likely to reverse.
 Distribution Areas: Detect zones where smart money is distributing to retail.
 Short Opportunities: Find optimal short entry points at high-volume bearish blocks.
 
  
Combined Strategies
 
 Order Block Stacking: Multiple aligned blocks create stronger support/resistance zones.
 Block Mitigation: When price breaks through a block, it often indicates a strong trend continuation.
 Volume Profile Applications: Higher volume segments provide more precise entry and exit points.
 
🔶 SETTINGS
Customization Options
Order Block Detection:
 
 Consolidation Lookback: Adjust the period for consolidation detection.
 Breakout Threshold: Set minimum percentage for breakout confirmation.
 Historical Lookback Limit: Control how far back to scan for historical order blocks.
 Maximum Order Blocks: Limit the number of visible blocks on the chart.
 
Visual Style:
 
 Grid Segments: Adjust the number of volume profile segments.
 Extend Blocks to Right: Enable/disable extending blocks to current price.
 Show Block Borders: Toggle border visibility.
 Border Width: Adjust thickness of block borders.
 Show Volume Text: Enable/disable volume labels.
 Volume Text Position: Control placement of volume labels.
 
Color Settings:
 
 Bullish High/Low Volume Colors: Customize appearance of bullish blocks.
 Bearish High/Low Volume Colors: Customize appearance of bearish blocks.
 Border Color: Set color for block outlines.
 Background Fill: Adjust color and transparency of block backgrounds.
 Volume Text Color: Customize label appearance.
 
Screener Table:
 
 Show Screener Table: Toggle table visibility.
 Table Position: Select positioning on the chart.
 Table Size: Adjust display size.
 
The Order Block Matrix indicator provides traders with powerful insights into market structure, helping to identify key levels where smart money is active and where high-probability trading opportunities may exist.
Breakout Swing High LowThis open-source indicator identifies swing high and swing low breakouts, providing clear visual signals for potential trend entries. It is designed for traders who use price action to spot breakout opportunities in trending markets.
How It Works  
Swing Detection: The indicator uses a user-defined lookback period (default: 4 candles) to identify swing highs (peaks) and swing lows (troughs). A swing high is confirmed when a candle's high is higher than the surrounding candles, and a swing low is confirmed when a candle's low is lower.
Breakout Signals: A green triangle below the candle signals a breakout above the most recent swing high, indicating a potential buy opportunity. A red triangle above the candle signals a breakout below the most recent swing low, indicating a potential sell opportunity. Each swing level triggers only one breakout signal to avoid clutter.
Visualization: Swing high levels are drawn as green dashed lines, and swing low levels as red dashed lines, extending 15 candles for clarity. Breakout signals are marked with small triangles.
How to Use  
Apply the Indicator: Add the indicator to your TradingView chart.
Adjust Lookback: Set the "Lookback Candles" input (default: 4) to control the sensitivity of swing detection. Smaller values detect shorter-term swings, while larger values identify more significant levels.
Interpret Signals:
Green triangle (below candle): Consider a buy opportunity when price breaks above a swing high.
Red triangle (above candle): Consider a sell opportunity when price breaks below a swing low.
Combine with Other Tools: Use in conjunction with trend indicators (e.g., 50-period EMA) or support/resistance levels to filter signals in trending markets.
Timeframes: Works best on higher timeframes (e.g., 1H, 4H) in trending markets to avoid false breakouts in sideways conditions.
Dynamic Liquidity Depth [BigBeluga]
 Dynamic Liquidity Depth    
 A liquidity mapping engine that reveals hidden zones of market vulnerability. This tool simulates where potential large concentrations of stop-losses may exist — above recent highs (sell-side) and below recent lows (buy-side) — by analyzing real price behavior and directional volume. The result is a dynamic two-sided volume profile that highlights where price is most likely to gravitate during liquidation events, reversals, or engineered stop hunts. 
 🔵 KEY FEATURES   
 
   Two-Sided Liquidity Profiles:   
Plots two separate profiles on the chart — one above price for potential  sell-side liquidity , and one below price for potential  buy-side liquidity . Each profile reflects the volume distribution across binned zones derived from historical highs and lows.
  
   Real Stop Zone Simulation:   
Each profile is offset from the current high or low using an ATR-based buffer. This simulates where traders might cluster their stop-losses above swing highs (short stops) or below swing lows (long stops).
  
   Directional Volume Analysis:   
Buy-side volume is accumulated only from bullish candles (close > open), while sell-side volume is accumulated only from bearish candles (close < open). This directional filtering enhances accuracy by capturing genuine pressure zones.
  
  
   Dynamic Volume Heatmap:   
Each liquidity bin is rendered as a horizontal box with a color gradient based on volume intensity:
  - Low activity bins are shaded lightly.
  - High-volume zones appear more vividly in red (sell) or lime (buy).
  - The  maximum volume bin  in each profile is emphasized with a brighter fill and a volume label.
   Extended POC Zones:   
The Point of Control (PoC) — the bin with the most volume — is extended backwards across the entire lookback period to mark critical resistance (sell-side) or support (buy-side) levels.
  
   Total Volume Summary Labels: 
At the center of each profile, a summary label displays  Total Buy Liquidity  and  Total Sell Liquidity  volume.
This metric helps assess directional imbalance — when buy liquidity is dominant, the market may favor upward continuation, and vice versa.
  
   Customizable Profile Granularity:   
You can fine-tune both  Resolution (Bins)  and  Offset Distance  to adjust how far profiles are displaced from price and how many levels are calculated within the ATR range.
 
 🔵 HOW IT WORKS   
 
  The indicator calculates an ATR-based buffer above highs and below lows to define the top and bottom of the liquidity zones.  
  Using a user-defined lookback period, it scans historical candles and divides the buffered zones into bins.  
  Each bin checks if bullish (or bearish) candles pass through it based on price wicks and body.  
  Volume from valid candles is summed into the corresponding bin.  
  When volume exists in a bin, a horizontal box is drawn with a width scaled by relative volume strength.  
  The bin with the highest volume is highlighted and optionally extended backward as a zone of importance.  
  Total buy/sell liquidity is displayed with a summary label at the side of the profile.
 
 🔵 USAGE/b]  
 
   Identify Stop Hunt Zones:  High-volume clusters near swing highs/lows are likely liquidation zones targeted during fakeouts.  
   Fade or Follow Reactions:  Price hitting a high-volume bin may reverse (fade opportunity) or break with strength (confirmation breakout).  
  
   Layer with Other Tools:  Combine with market structure, order blocks, or trend filters to validate entries near liquidity.  
   Adjust Offset for Sensitivity:  Use higher offset to simulate wider stop placement; use lower for tighter scalping zones.
 
 🔵 CONCLUSION   
 Dynamic Liquidity Depth   transforms raw price and volume into a spatial map of liquidity. By revealing areas where stop orders are likely hidden, it gives traders insight into price manipulation zones, potential reversal levels, and breakout traps. Whether you're hunting for traps or trading with the flow, this tool equips you to navigate liquidity with precision.
Smart Range DetectorSmart Range Detector 
 What It Does 
This indicator automatically detects and validates significant trading ranges using pivot point analysis combined with logarithmic fibonacci relationships. It operates by identifying specific pivot patterns (High-Low-High and Low-High-Low) that meet fibonacci validation criteria to filter out noise and highlight only the most reliable trading ranges. Each range is continuously monitored for potential mitigation (breakout) events.
 Key Features 
 
  Identifies both High-Low-High and Low-High-Low range patterns
  Validates each range using logarithmic fibonacci relationships (more accurate than linear fibs)
  Detects range mitigations (breakouts) and visually differentiates them
  Shows fibonacci levels within ranges (25%, 50%, 75%) for potential reversal points
  Visualizes extension levels beyond ranges for breakout targets
  Analyzes volume profile with customizable price divisions (default: 60)
  Displays Point of Control (POC) and Value Area for traded volume analysis
  Implements performance optimization with configurable range limits
  Includes user-adjustable safety checks to prevent Pine Script limitations
  Offers fully customizable colors, line widths, and transparency settings
 
 How To Use It 
 
   Identify Valid Ranges : The indicator automatically detects and highlights trading ranges that meet fibonacci validation criteria
   Monitor Fibonacci Levels : Watch for price reactions at internal fib levels (25%, 50%, 75%) for potential reversal opportunities
   Track Extension Targets : Use the extension lines as potential targets when price breaks out of a range
   Analyze Volume Structure : Enable the volume profile mode to see where most volume was traded within mitigated ranges
   Trade Range Boundaries : Look for reactions at range highs/lows combined with volume POC for higher probability entries
   Manage Performance : Adjust the maximum displayed ranges and history bars settings for optimal chart performance
 
 Settings Guide 
 
   Left/Right Bars Look Back : Controls how far back the indicator looks to identify pivot points (higher values find more ranges but may reduce sensitivity)
   Max History Bars : Limits how far back in history the indicator will analyze (stays within Pine Script's 10,000 bar limitation)
   Max Ranges to Display : Restricts the total number of ranges kept in memory for improved performance (1-50)
   Volume Profile : When enabled, shows volume distribution analysis for mitigated ranges
   Volume Profile Divisions : Controls the granularity of the volume analysis (higher values show more detail)
   Display Options : Toggle visibility of range lines, fibonacci levels, extension lines, and volume analysis elements
   Transparency & Color Settings : Fully customize the visual appearance of all indicator elements
   Line Width Settings : Adjust the thickness of lines for better visibility on different timeframes
 
 Technical Details 
 
  The indicator uses logarithmic fibonacci calculations for more accurate price relationships
  Volume profile analysis creates 60 price divisions by default (adjustable) for detailed volume distribution
  All timestamps are properly converted to work with Pine Script's bar limitations
  Safety checks prevent "array index out of bounds" errors that plague many complex indicators
  Time-based coordinates are used instead of bar indices to prevent "bar index too far" errors
 
This indicator works well on all timeframes and instruments, but performs best on 5-minute to daily charts. Perfect for swing traders, range traders, and breakout strategists.
 What Makes It Different 
Most range indicators simply draw boxes based on recent highs and lows. Smart Range Detector validates each potential range using proven fibonacci relationships to filter out noise. It then adds sophisticated volume analysis to help traders identify the most significant price levels within each range. The performance optimization features ensure smooth operation even on lower timeframes and extended history analysis. 
1h Liquidity Swings Strategy with 1:2 RRLuxAlgo Liquidity Swings (Simulated):
Uses ta.pivothigh and ta.pivotlow to detect 1h swing highs (resistance) and swing lows (support).
The lookback parameter (default 5) controls swing point sensitivity.
Entry Logic:
Long: Uptrend, price crosses above 1h swing low (ta.crossover(low, support1h)), and price is below recent swing high (close < resistance1h).
Short: Downtrend, price crosses below 1h swing high (ta.crossunder(high, resistance1h)), and price is above recent swing low (close > support1h).
Take Profit (1:2 Risk-Reward):
Risk:
Long: risk = entryPrice - initialStopLoss.
Short: risk = initialStopLoss - entryPrice.
Take-profit price:
Long: takeProfitPrice = entryPrice + 2 * risk.
Short: takeProfitPrice = entryPrice - 2 * risk.
Set via strategy.exit’s limit parameter.
Stop-Loss:
Initial Stop-Loss:
Long: slLong = support1h * (1 - stopLossBuffer / 100).
Short: slShort = resistance1h * (1 + stopLossBuffer / 100).
Breakout Stop-Loss:
Long: close < support1h.
Short: close > resistance1h.
Managed via strategy.exit’s stop parameter.
Visualization:
Plots:
50-period SMA (trendMA, blue solid line).
1h resistance (resistance1h, red dashed line).
1h support (support1h, green dashed line).
Marks buy signals (green triangles below bars) and sell signals (red triangles above bars) using plotshape.
Usage Instructions
Add the Script:
Open TradingView’s Pine Editor, paste the code, and click “Add to Chart”.
Set Timeframe:
Use the 1-hour (1h) chart for intraday trading.
Adjust Parameters:
lookback: Swing high/low lookback period (default 5). Smaller values increase sensitivity; larger values reduce noise.
stopLossBuffer: Initial stop-loss buffer (default 0.5%).
maLength: Trend SMA period (default 50).
Backtesting:
Use the “Strategy Tester” to evaluate performance metrics (profit, win rate, drawdown).
Optimize parameters for your target market.
Notes on Limitations
LuxAlgo Liquidity Swings:
Simulated using ta.pivothigh and ta.pivotlow. LuxAlgo may include proprietary logic (e.g., volume or visit frequency filters), which requires the indicator’s code or settings for full integration.
Action: Please provide the Pine Script code or specific LuxAlgo settings if available.
Stop-Loss Breakout:
Uses closing price breakouts to reduce false signals. For more sensitive detection (e.g., high/low-based), I can modify the code upon request.
Market Suitability:
Ideal for high-liquidity markets (e.g., BTC/USD, EUR/USD). Choppy markets may cause false breakouts.
Action: Backtest in your target market to confirm suitability.
Fees:
Take-profit/stop-loss calculations exclude fees. Adjust for trading costs in live trading.
Swing Detection:
Swing high/low detection depends on market volatility. Optimize lookback for your market.
Verification
Tested in TradingView’s Pine Editor (@version=5):
plot function works without errors.
Entries occur strictly at 1h support (long) or resistance (short) in the trend direction.
Take-profit triggers at 1:2 risk-reward.
Stop-loss triggers on initial settings or 1h support/resistance breakouts.
Backtesting performs as expected.
Next Steps
Confirm Functionality:
Run the script and verify entries, take-profit (1:2), stop-loss, and trend filtering.
If issues occur (e.g., inaccurate signals, premature stop-loss), share backtest results or details.
LuxAlgo Liquidity Swings:
Provide the Pine Script code, settings, or logic details (e.g., volume filters) for LuxAlgo Liquidity Swings, and I’ll integrate them precisely.
OpeningRange (Trading_Tix)Purpose:
The indicator highlights the high, low, and middle (50%) price levels of a specified session's opening range. These levels can serve as key support and resistance zones for trading strategies. The indicator also offers options to extend these levels beyond the session into later timeframes, making it useful for tracking breakout or trend continuation setups.
Key Features:
1. Session Detection:
The indicator identifies a specific session period using the user-defined Session Time. It calculates the start time, high, and low prices during this period:
rangeTime: Defines the session time range (default: 5:00 PM to 2:59 AM).
extendTime: Defines the extended time range where lines/backgrounds can be prolonged.
2. Opening Range Calculation:
High (high_val) and Low (low_val)**:
Tracks the highest and lowest prices during the session.
Middle Line:
A midpoint is calculated by averaging high_val and low_val.
3. Visual Elements:
Horizontal Lines:
Drawn at the high, low, and middle levels.
Customizable in width and color.
Shaded Background Box:
Covers the range between high and low prices.
The box’s color and transparency can be adjusted.
Line and Box Extension:
Optionally extends these elements into the extended time range.
4. Customization:
Users have the flexibility to:
Toggle visibility of lines, middle line, and background box.
Adjust colors, line thickness, and style.
Enable or disable the extension of lines and backgrounds into the extended period.
How It Works:
Initialization:
The script initializes variables to store range data (startTime, high_val, low_val) and drawing objects (lines, boxes).
It detects whether the current bar falls within the session (inSession) or extended timeframe (inExtend).
Plotting:
During the session:
Deletes previous lines and boxes from prior sessions.
Draws new lines at the high, low, and middle levels.
Creates a background box covering the range, if enabled.
During the extended period:
Extends the session lines and box, if the user has opted for extensions.
Updates:
Continuously adjusts the high/low values and updates the lines as new price data arrives.
Use Cases:
This indicator can be valuable for traders who:
Use the opening range to identify potential breakout zones.
Trade based on price consolidation within the range.
Want a visual representation of key price levels to plan entries and exits.
Would you like help refining this script further or adjusting its settings to match your trading style?
Liquidity Levels (Smart Swing Lows)Liquidity Levels — Smart Swing Low Detection
Efficient Liquidity Sweep Visualization for Smart Money Traders
This script automatically identifies and plots liquidity-rich swing lows based on pivot logic, filters them to remove redundant levels, and overlays daily highs/lows for added context — giving Smart Money Concept (SMC) traders a clean, actionable map of liquidity.
It’s designed to be minimal yet powerful: perfect for spotting potential liquidity grabs, mitigation zones, and sweep targets with zero chart clutter.
🔍 What This Script Does:
Detects Smart Swing Lows
Uses fixed pivot detection (left = 3, right = customizable) to identify structurally significant swing lows.
Filters out swing lows that are too close together using a percentage-based spacing threshold to reduce noise.
Mitigation Cleanup Logic
Tracks whether recent price action breaches past swing lows.
If breached, the swing level is automatically removed, keeping only relevant, unmitigated liquidity levels on your chart.
Plots Daily Highs and Lows
Each new trading day, horizontal rays mark the prior day’s high and low — useful for identifying resting liquidity and possible sweep zones.
Labeling and Style Customization
Optional labels for swing lows.
Full control over label size, color, and visibility to match any chart aesthetic.
Timeframe Filtering
Runs exclusively on 5m, 10m, and 15m charts to ensure optimal reliability and signal clarity.
⚙️ Customization Features:
Pivot sensitivity (Right side control)
Minimum distance between swing lows (in %)
Label visibility, size, and color
Line width and colors for both swing levels and daily highs/lows
Mitigation cleanup lookback length
💡 How to Use:
Add the script to a qualifying intraday chart (5–15m).
Use the swing low levels to monitor liquidity-rich zones.
Combine with your personal strategy to identify liquidity grabs, potential reversal zones, or entry points following a sweep.
Let the built-in cleanup logic remove any already-mitigated levels so you can focus on active targets.
🚀 What Makes It Unique:
This isn’t just another pivot plotter — it’s a smart, self-cleaning SMC tool designed for modern liquidity-based trading strategies.
A must-have for traders using concepts like liquidity grabs, mitigation blocks, or sweep-to-reverse trade models.
🔗 Best used in combination with:
✅ First FVG — Opening Range Fair Value Gap Detector: Pinpoint the day’s first imbalance zone for intraday setups.
✅ ICT SMC Liquidity Grabs + OB + Fibonacci OTE Levels: Confluence-based entries powered by liquidity logic, order blocks, and premium/discount zones.
Used together, these scripts form a complete Smart Money toolkit — helping you build high-probability setups with confidence, clarity, and clean charts.
Intraday Uncertainty [PhenLabs]📊 Intraday Uncertainty  
 Version: PineScript™ v6 
 📌 Description 
The Intraday Uncertainty indicator offers traders a visual representation of market certainty/uncertainty during trading sessions. By comparing each price bar’s range to the Average True Range (ATR), it provides an intuitive way to gauge market conviction through a color gradient system.
This tool helps traders identify periods of high certainty (potentially trending markets) versus high uncertainty (potentially choppy or volatile markets) without complex calculations or multiple indicators. The color-coded bars create an immediate visual cue to support decision-making in varying market conditions.
 🚀 Points of Innovation 
 
 Automated range-to-ATR ratio calculation that adapts to changing market volatility
 Dynamic color gradient system that visually distinguishes between certain and uncertain price action
 Customizable gradient clamping to fine-tune sensitivity to market conditions
 Integrated dashboard that provides clear interpretation guidance
 Position-flexible legend that accommodates different chart layouts
 Highly optimized for performance with minimal calculation overhead
 
 🔧 Core Components 
 
 ATR Calculation: Measures market volatility using a configurable lookback period
 Range-to-ATR Ratio: Compares current bar’s high-low range against average volatility
 Gradient Mapping System: Converts numerical uncertainty values into an intuitive color scale
 Dashboard Legend: Provides clear interpretation guidance with customizable positioning
 
 🔥 Key Features 
 
 Bar Coloring: Instantly identifies market certainty levels through intuitive color gradients
 Customizable ATR Period: Adjust sensitivity to historical volatility based on trading style
 Gradient Clamping: Fine-tune the color sensitivity using the Range/ATR multiplier
 Color Customization: Personalize the color scheme to match your chart aesthetics
 Informative Dashboard: Quickly interpret color meanings with the optional on-chart legend
 Flexible Display Options: Customize dashboard position and text size for your chart layout
 
 🎨 Visualization 
 
 Color Gradient: Bars colored on a spectrum from green (high certainty) to red (high uncertainty)
 Dashboard Legend: Optional on-chart guide explaining the color interpretation
 Color Intensity: Stronger colors indicate more extreme certainty/uncertainty levels
 At-a-glance Interpretation: Quickly identify market conviction without analyzing numbers
 
 📖 Usage Guidelines 
 Calculation Settings 
 
 ATR Period
Default: 14
Range: 1+
Description: Controls the lookback period for ATR calculation. Lower values increase sensitivity to recent volatility, while higher values provide more stability.
 Gradient Clamp (Range/ATR Multiplier)
Default: 2.0
Range: 0.1+
Description: Sets the maximum Range/ATR ratio for gradient scaling. Ranges above this value display the end color (high uncertainty).
 
 Color Settings 
 
 Gradient Start Color (High Certainty)
Default: Green
Description: Color representing high market certainty (low Range/ATR ratio)
 Gradient End Color (Low Certainty)
Default: Red
Description: Color representing low market certainty (high Range/ATR ratio)
 
 Dashboard Settings 
 
 Show Dashboard Legend
Default: True
Description: Toggles the visibility of the on-chart interpretation guide
 Dashboard Position
Options: top_right, top_left, bottom_right, bottom_left, middle_right, middle_left
Default: bottom_right
Description: Controls the placement of the dashboard on your chart
 Dashboard Text Size
Options: tiny, small, normal, large, huge
Default: normal
Description: Adjusts the text size of the dashboard for readability
 
 ✅ Best Use Cases 
 
 Identifying potential trend shifts when certainty levels change dramatically
 Confirming trend strength through consistent certainty levels
 Detecting choppy/sideways markets with persistent high uncertainty
 Filtering trading signals from other indicators based on certainty levels
 Gauging market conviction behind price breakouts or pullbacks
 Optimizing entry/exit timing based on certainty/uncertainty transitions
 
 ⚠️ Limitations 
 
 Does not predict future price direction, only measures current bar certainty
 May provide false signals during news events or unexpected volatility spikes
 Requires context within the broader market environment for optimal interpretation
 Color interpretation is relative rather than absolute across different securities
 ATR-based calculation means sensitivity varies across different timeframes
 
 💡 What Makes This Unique 
 
 Simplicity: Single visual indicator that doesn’t require multiple technical tools
 Adaptability: Automatically adjusts to changing market volatility conditions
 Contextual Analysis: Provides market conviction context beyond just price movement
 Intuitive Design: Color-based system that requires minimal learning curve
 Efficiency: Lightweight calculation that doesn’t impact chart performance
 
 🔬 How It Works 
 
 1. ATR Calculation:
Calculates the Average True Range using the specified period
Establishes a baseline for normal market volatility
 2. Range Analysis:
Measures each bar’s high-low range
Compares this range to the current ATR value to create a ratio
 3. Gradient Mapping:
Converts the Range/ATR ratio to a normalized value between 0 and 1
Maps this value onto a color gradient between the start and end colors
Applies the resulting color to the price bar
 4. Dashboard Creation:
Constructs an information panel on the last visible bar
Populates it with color samples and interpretation guidance
 
 💡 Note: 
This indicator works best when used in conjunction with other technical analysis tools rather than in isolation. The certainty/uncertainty measure provides context for your trading decisions but should not be the sole basis for entries and exits. Consider using higher certainty periods for trend-following strategies and exercise caution during periods of high uncertainty. 
D3m4h GIFVGDescription 
D3m4h GIFVG is an indicator designed to automatically detect market imbalances—often referred to as FVGs (Fair Value Gaps)—and potential pivot-based shifts in market structure. It offers a dynamic approach to visualizing supply/demand inefficiencies and pivot-based trend changes. Key features include:
 1. Pivot-Based Bullish/Bearish Detection 
The indicator identifies higher-high/lower-low pivot logic as well as “outside bar” pivots.
It tracks when the market transitions from bullish to bearish ranges, or vice versa, by using multiple checks:
 
 Pivot low/high detection
 Break-of-structure (when price crosses the last pivot)
 Opposing FVG detection to confirm an intraday pivot shift
 
 2. FVG (Fair Value Gap) Detection 
The script automatically scans for bullish or bearish FVG conditions:
 
 Bullish FVG: Candle at position (bar_index - 2) has a high below the current candle’s low.
 Bearish FVG: Candle at position (bar_index - 2) has a low above the current candle’s high.
 
When it detects an FVG, it draws a box on the chart to highlight the price gap (yellow boxes by default).
 3. Pivot Range FVG 
If an FVG forms while the market is in a bullish pivot range, the script can paint a special “blue” FVG to underscore its significance. The same logic applies if a newly formed FVG appears in a bearish pivot range.
 4. Filled Gap Cleanup 
You can optionally hide standard FVG boxes once they’re filled. For example, if the candle’s body (or candle range) covers that gap, the box is removed to keep your chart clean.
 5. Pivot-Range FVG “Raided” Cleanup 
If the pivot-based FVG is later filled from the opposing direction, it turns green and can optionally remove itself after a set number of bars.
 6. Informative Table 
A small table on the chart optionally displays whether or not the pivot-based FVG has been “raided”. You can toggle this table on/off in the settings.
 How It Works 
 1. Pivot Shifts 
The script tracks the last pivot high/low using a combination of candle-based pivot detection and break-of-structure checks (when price crosses the last pivot in the opposite direction).
When a shift is detected, the pivot range ID increments—this helps the script know when to remove old pivot-based FVGs or draw new ones.
 2. FVG Formation 
Each new bar checks if a bullish or bearish FVG formed (comparing the high of bar two bars ago to the current low, or the low of bar two bars ago to the current high).
If one is found, a box is drawn to highlight the imbalance. Its color and extension depend on script settings.
 3. Imbalance or Pivot FVG 
Standard imbalance boxes appear in yellow.
If the new imbalance coincides with a bullish or bearish pivot range, a special “pivot imbalance” box in blue is drawn.
 3. Hide Filled 
If a newly formed candle’s body fully covers the FVG, the box is considered filled. If Hide Filled Gaps is enabled, the box is deleted once it’s covered.
 4. Raid Status 
For the pivot-based (blue) FVG, once price invalidates it from the opposite side, it changes color to green and gets removed after a user-defined number of bars.
 How to Use 
 1. Look for FVGs 
Observe yellow boxes to identify potential intraday imbalances. Watch for price returning to fill these zones.
If you see a “blue” box, it signifies a pivot-based FVG in line with a recognized shift in structure—arguably a higher-probability zone.
 2. “Hide Filled Gaps” 
Turn this on if you only want to see currently active or partially filled imbalances. The script cleans up old, fully covered boxes to keep your chart neat.
 3. Pivot Shifts 
Note the script’s internal pivot logic. Each new pivot re-defines bullish or bearish states. Use these states to gauge the short-term trend shifts.
 4. Toggle the Table 
You can show or hide the chart table by enabling/disabling “Show Table” from the inputs. This table indicates if the pivot-based “GIFVG” has been “raided” or not.
 5. Extend Count 
Adjust the extendCount in the code if you want FVG boxes to extend further or shorter in time.
 Underlying Concepts 
 Fair Value Gaps 
Market inefficiencies that occur when price jumps, leaving a “gap” from the candle 2 bars ago to the current candle. They can act like mini supply/demand zones where price may revisit for balance.
 Pivot Ranges 
The script tries to maintain an internal sense of whether the market is in a bullish or bearish pivot range. When it sees a contrary FVG or break-of-structure, it flips the pivot state.
 Outside Bars 
A candle that has both a higher high and a lower low than the previous bar. The script uses these to mark significant pivot shifts.
By combining pivot-based logic with FVG detection, the D3m4h GIFVG indicator helps highlight potential areas of liquidity or unfilled value. Traders can use these zones to plan entries/exits or to confirm short-term trend shifts.
Market Sessions & LevelsOverview
This Pine Script indicator identifies key trading levels and market sessions, making it easier for traders to analyze price movements. It highlights the previous day's high and low, tracks premarket price action, and marks the first 5-minute high and low after the market opens.
Features
✅ Identifies Market Sessions:
Pre-Market Session (4:30 AM - 9:30 AM EST)
Regular Market Session (9:30 AM - 4:00 PM EST)
✅ Tracks Key Levels:
Previous Day’s High & Low
Premarket High & Low
First 5-Minute High & Low after market open
✅ Visual Cues for Easy Analysis:
Plots horizontal lines for each level with distinct colors
Displays labels for key price levels on the chart
How It Helps Traders
📊 Pre-Market Preparation: Helps traders spot key resistance/support levels before the market opens.
🚀 Momentum Trading: The first 5-minute high/low can act as breakout or reversal zones.
📉 Historical Price Context: Uses the previous day's high/low to gauge market sentiment.
Customization
The script can be easily modified to adjust session timings, colors, or additional levels based on your trading strategy.
💡 How to Use:
Apply the script to a 1-minute or 5-minute chart for the most accurate premarket and first 5-minute tracking.
Look for price reactions at the plotted levels to determine potential trade setups.






















